'use strict';

const qs = require('qs');
const mockjs = require('mockjs');

module.exports = {

	'GET /api/userlist' (req, res) {
		const page = qs.parse(req.query);
		const pageSize = parseInt(page.pageSize || 10),
			data = [];
		for (var i = 1; i <= pageSize; i++) {
			data.push({
				uid: i,
				key: i,
				nick_name: "小小" + i,
				address: "地址。。。",
			});
		}
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				total: 32125,
				size: pageSize,
				page: parseInt(req.query && req.query.page || 1),
				data: data
			});
		}, 500);
	},
	'GET /api/sex' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "男",
					value: 658
				}, {
					name: "女",
					value: 823
				}]
			});
		}, 500);
	},
	'GET /api/age' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "20 以下",
					value: 3177
				}, {
					name: "21~25",
					value: 4123
				}, {
					name: "26~30",
					value: 2385
				}, {
					name: "31~35",
					value: 5397
				}, {
					name: "35~40",
					value: 2456
				}, {
					name: "40 以上",
					value: 3997
				}]
			});
		}, 1500);
	},
	'GET /api/area' (req, res) {
		setTimeout(function() {
			res.json({
				"status": 200,
				"desc": "",
				"success": true,
				"data": [{
					"province": "北京",
					"count": 66,
					"countPct": 15.38,
					"nationalPct": 2.39
				}, {
					"province": "广东",
					"count": 62,
					"countPct": 14.45,
					"nationalPct": 11.29
				}, {
					"province": "上海",
					"count": 30,
					"countPct": 6.99,
					"nationalPct": 2.58
				}, {
					"province": "江苏",
					"count": 26,
					"countPct": 6.06,
					"nationalPct": 6.42
				}, {
					"province": "辽宁",
					"count": 21,
					"countPct": 4.9,
					"nationalPct": 3.97
				}, {
					"province": "河北",
					"count": 21,
					"countPct": 4.9,
					"nationalPct": 5.42
				}, {
					"province": "陕西",
					"count": 20,
					"countPct": 4.66,
					"nationalPct": 2.74
				}, {
					"province": "山东",
					"count": 19,
					"countPct": 4.43,
					"nationalPct": 6.96
				}, {
					"province": "浙江",
					"count": 19,
					"countPct": 4.43,
					"nationalPct": 5.22
				}, {
					"province": "四川",
					"count": 18,
					"countPct": 4.2,
					"nationalPct": 4.74
				}, {
					"province": "安徽",
					"count": 16,
					"countPct": 3.73,
					"nationalPct": 3.48
				}, {
					"province": "天津",
					"count": 16,
					"countPct": 3.73,
					"nationalPct": 1.39
				}, {
					"province": "湖北",
					"count": 13,
					"countPct": 3.03,
					"nationalPct": 3.96
				}, {
					"province": "黑龙江",
					"count": 12,
					"countPct": 2.8,
					"nationalPct": 2.48
				}, {
					"province": "山西",
					"count": 11,
					"countPct": 2.56,
					"nationalPct": 2.87
				}, {
					"province": "河南",
					"count": 11,
					"countPct": 2.56,
					"nationalPct": 5.38
				}, {
					"province": "重庆",
					"count": 8,
					"countPct": 1.86,
					"nationalPct": 2.1
				}, {
					"province": "内蒙古",
					"count": 7,
					"countPct": 1.63,
					"nationalPct": 1.83
				}, {
					"province": "吉林",
					"count": 6,
					"countPct": 1.4,
					"nationalPct": 1.91
				}, {
					"province": "湖南",
					"count": 5,
					"countPct": 1.17,
					"nationalPct": 3.9
				}, {
					"province": "福建",
					"count": 5,
					"countPct": 1.17,
					"nationalPct": 3.85
				}, {
					"province": "新疆",
					"count": 4,
					"countPct": 0.93,
					"nationalPct": 1.83
				}, {
					"province": "云南",
					"count": 3,
					"countPct": 0.7,
					"nationalPct": 2.56
				}, {
					"province": "江西",
					"count": 3,
					"countPct": 0.7,
					"nationalPct": 2.56
				}, {
					"province": "贵州",
					"count": 3,
					"countPct": 0.7,
					"nationalPct": 1.96
				}, {
					"province": "甘肃",
					"count": 3,
					"countPct": 0.7,
					"nationalPct": 1.46
				}, {
					"province": "广西",
					"count": 1,
					"countPct": 0.23,
					"nationalPct": 2.95
				}]
			});
		}, 2500);
	},
	'GET /api/city' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "北京",
					value: 5177
				}, {
					name: "上海",
					value: 6123
				}, {
					name: "广州",
					value: 5385
				}, {
					name: "深圳",
					value: 4197
				}, {
					name: "成都",
					value: 5456
				}, {
					name: "南京",
					value: 3997
				}]
			});
		}, 1500);
	},
	'GET /api/xingzuo' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "白羊座",
					value: 3177
				}, {
					name: "金牛座",
					value: 4123
				}, {
					name: "双子座",
					value: 2385
				}, {
					name: "巨蟹座",
					value: 3397
				}, {
					name: "狮子座",
					value: 2456
				}, {
					name: "处女座",
					value: 3557
				}]
			});
		}, 1500);
	},
	'GET /api/rate' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "几乎每天",
					value: 19
				}, {
					name: "从来不化",
					value: 7
				}, {
					name: "很少化",
					value: 13
				}, {
					name: "每周1-2天",
					value: 19
				}, {
					name: "每周3-4天",
					value: 42
				}]
			});
		}, 500);
	},
	'GET /api/preference' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "底妆",
					value: 2345
				}, {
					name: "唇妆",
					value: 1346
				}, {
					name: "眼妆",
					value: 567
				}]
			});
		}, 1500);
	},
	'GET /api/occasion' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "日常生活",
					value: 1234
				}, {
					name: "职场",
					value: 2343
				}, {
					name: "聚会",
					value: 3354
				}, {
					name: "约会",
					value: 7456
				}, {
					name: "宴会",
					value: 3465
				}]
			});
		}, 1500);
	},
	'GET /api/activity' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "活动名称1",
					value: 1234
				}, {
					name: "活动名称12",
					value: 2343
				}, {
					name: "活动名称123",
					value: 3354
				}, {
					name: "活动名称1234",
					value: 7456
				}, {
					name: "活动名称123456",
					value: 3465
				}]
			});
		}, 1500);
	},
	'GET /api/source' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "微信",
					value: 6
				}, {
					name: "微博",
					value: 11
				}, {
					name: "官网",
					value: 16
				}, {
					name: "门店",
					value: 35
				}, {
					name: "电商",
					value: 16
				}, {
					name: "其他",
					value: 16
				}]
			});
		}, 2500);
	},
	'GET /api/class' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: {
					outside: [{
						value: 335,
						name: '直达'
					}, {
						value: 310,
						name: '邮件营销'
					}, {
						value: 234,
						name: '联盟广告'
					}, {
						value: 135,
						name: '视频广告'
					}, {
						value: 1048,
						name: '百度'
					}, {
						value: 251,
						name: '谷歌'
					}, {
						value: 147,
						name: '必应'
					}, {
						value: 102,
						name: '其他'
					}],
					inside: [{
						value: 335,
						name: '直达'
					}, {
						value: 679,
						name: '营销广告'
					}, {
						value: 1548,
						name: '搜索引擎'
					}]
				}
			});
		}, 2500);
	},
	'GET /api/effect' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					value: 335,
					name: '保湿'
				}, {
					value: 679,
					name: '遮瑕'
				}, {
					value: 1548,
					name: '美白'
				}, {
					value: 1548,
					name: '色彩'
				}]
			});
		}, 2500);
	},
	'GET /api/product' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "微信",
					value: 6
				}, {
					name: "微博",
					value: 11
				}, {
					name: "官网",
					value: 16
				}, {
					name: "门店",
					value: 35
				}, {
					name: "电商",
					value: 16
				}, {
					name: "其他",
					value: 16
				}]
			});
		}, 2500);
	},
	'GET /api/color' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "微信1",
					value: 6
				}, {
					name: "微博2",
					value: 11
				}, {
					name: "官网3",
					value: 16
				}, {
					name: "门店4",
					value: 35
				}, {
					name: "电商5",
					value: 16
				}, {
					name: "其他6",
					value: 16
				}]
			});
		}, 2500);
	},
	'GET /api/viscosity' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "微信1",
					value: 6
				}, {
					name: "微博2",
					value: 11
				}, {
					name: "官网3",
					value: 16
				}, {
					name: "门店4",
					value: 35
				}, {
					name: "电商5",
					value: 16
				}, {
					name: "其他6",
					value: 16
				}]
			});
		}, 2500);
	},
	'GET /api/vitality' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "微信11",
					value: 6
				}, {
					name: "微博22",
					value: 11
				}, {
					name: "官网33",
					value: 16
				}, {
					name: "门店44",
					value: 35
				}, {
					name: "电商55",
					value: 16
				}, {
					name: "其他66",
					value: 16
				}]
			});
		}, 2500);
	},
	'GET /api/worth' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "微信111",
					value: 6
				}, {
					name: "微博222",
					value: 11
				}, {
					name: "官网333",
					value: 16
				}, {
					name: "门店444",
					value: 35
				}, {
					name: "电商555",
					value: 16
				}, {
					name: "其他666",
					value: 16
				}]
			});
		}, 2500);
	},
	'GET /api/spread' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "微信微信",
					value: 6
				}, {
					name: "微博微博",
					value: 11
				}, {
					name: "官网3",
					value: 16
				}, {
					name: "门店4",
					value: 35
				}, {
					name: "电商5",
					value: 16
				}, {
					name: "其他6",
					value: 16
				}]
			});
		}, 2500);
	},
	'GET /api/spreadWeixin' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "微信11",
					value: 6
				}, {
					name: "微博22",
					value: 11
				}, {
					name: "官网官网3",
					value: 16
				}, {
					name: "门店门店",
					value: 35
				}, {
					name: "电商55",
					value: 16
				}, {
					name: "其他66",
					value: 16
				}]
			});
		}, 2500);
	},
	'GET /api/spreadContent' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "微信111",
					value: 6
				}, {
					name: "微博222",
					value: 11
				}, {
					name: "官网333",
					value: 16
				}, {
					name: "门店444",
					value: 35
				}, {
					name: "电商电商555",
					value: 16
				}, {
					name: "其他其他666",
					value: 16
				}]
			});
		}, 2500);
	},
	'GET /api/activityTheme' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "活动主题偏好",
					value: 6
				}, {
					name: "微博222",
					value: 11
				}, {
					name: "官网333",
					value: 16
				}, {
					name: "门店444",
					value: 35
				}, {
					name: "电商电商555",
					value: 16
				}, {
					name: "其他其他666",
					value: 16
				}]
			});
		}, 2500);
	},
	'GET /api/activityValue' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "活动利益偏好",
					value: 6
				}, {
					name: "微博2",
					value: 11
				}, {
					name: "官网3",
					value: 16
				}, {
					name: "门店4",
					value: 35
				}, {
					name: "电商电商5",
					value: 16
				}, {
					name: "其他其他6",
					value: 16
				}]
			});
		}, 2500);
	},
	'GET /api/marketing' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "整体互动意愿",
					value: 6
				}, {
					name: "微博2",
					value: 11
				}, {
					name: "官网3",
					value: 16
				}, {
					name: "门店4",
					value: 35
				}, {
					name: "电商电商5",
					value: 16
				}, {
					name: "其他其他6",
					value: 16
				}]
			});
		}, 2500);
	},
	'GET /api/marketingTheme' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					value: 335,
					name: '活动主题偏好'
				}, {
					value: 679,
					name: '遮瑕'
				}, {
					value: 1548,
					name: '美白'
				}, {
					value: 1548,
					name: '色彩'
				}]
			});
		}, 2500);
	},
	'GET /api/marketingModel' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "活动形式偏好",
					value: 6
				}, {
					name: "微博2",
					value: 11
				}, {
					name: "官网3",
					value: 16
				}, {
					name: "门店4",
					value: 35
				}, {
					name: "电商电商5",
					value: 16
				}, {
					name: "其他其他6",
					value: 16
				}]
			});
		}, 2500);
	},
	'GET /api/marketingValue' (req, res) {
		setTimeout(function() {
			res.json({
				success: true,
				status: 200,
				data: [{
					name: "活动利益偏好",
					value: 6
				}, {
					name: "微博2",
					value: 11
				}, {
					name: "官网3",
					value: 16
				}, {
					name: "门店4",
					value: 35
				}, {
					name: "电商电商5",
					value: 16
				}, {
					name: "其他其他6",
					value: 16
				}]
			});
		}, 2500);
	},
};